package cate.game.activity.accumulatedaypay.msg;

import cate.game.GameBody;
import cate.game.activity.accumulatedaypay.RoleAccumulateDayPay;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBAccumulateDayPay;
import easy.java.dev.note.NoteField;
import easy.java.practice.errorcode.EcResult;

@ClientMsg(title = "领取充值奖励 の 请求")
public class AccumulateDayPayGetPayRwdReq implements MsgInput {
    @NoteField("功能ID")
    public int funcId;

    @NoteField("天数")
    public int day;

    @Override
    public MsgConfig conf() {
        return MsgIdBAccumulateDayPay.GET_PAY_RWD_REQ;
    }

    @Override
    public void execute(GameBody game, ClientContext cc) {
        RoleAccumulateDayPay single = cc.getRole().getActivity().getEnableActivitySingle(funcId);
        if (single == null) {
            cc.getRole().getGame().notice.message(cc.getRole(), "活动未开启");
            return;
        }
        EcResult<Void> r = single.getPayRwd(day);
        game.notice.message(cc.getRole(), r, true);
    }
}
